<?php
namespace app\index\controller;
use \think\Controller;
use \think\Cookie;
use \think\Db;
class Base extends Controller
{

   protected function _initialize()
    {
    	//头部当行蓝
		$index_menu=Db::name("index_menu")->where(["state"=>0,"type"=>0])->order("id","asc")->select();
		foreach ($index_menu as $key => $value) {
			$url = url($value['url']);
        	$index_menu[$key]['urll'] = $url;
		}
		$this->assign('index_menu',$index_menu);

		// 顶部BANNER
		$top_banner=Db::name("banner")->where("type",1)->order("id","desc")->find();
		$this->assign('top_banner',$top_banner);
		// var_dump($index_menu);
          //底部基本信息
		$company=Db::name("company")->order("id","desc")->find();
		$this->assign('company',$company);
		// 友情链接
		$friendly=Db::name("friendly")->order("id","desc")->select();
		$this->assign('friendly',$friendly);
    }
}
